<template>
  <div class="page">
    <!-- 表单 -->

    <a-card>
      <com-vxe-table
        :columns="columns"
        :axios="page"
        :fromItem="fromItem"
        :formData="formData"
        :initialize="initialize"
        @check-view="checkView"
        ref="xTable"
      >
        <template #operate="data">
          <div>
            <vxe-button
              title="查看"
              status="primary"
              content="查看"
              @click="data.callback(data.row)"
            ></vxe-button>
          </div>
        </template>
      </com-vxe-table>
    </a-card>
    <year-model ref="model" :refs="$refs" :toSubmit="true" @refresh="$refs.xTable.getQueryList()" :back="true">
      <template #default="data"> 
        <tas-component :active="active" :panes="panes" :panesIndex="1" @active="tabsCallback">
          <template>
            <ypscForm :params="data.ndkp" :nextNodeDbrList="data.nextNodeDbrList" :nextNode="data.nextNode" ref="form" v-show="active=='1'"></ypscForm>
            <YregisteredView :params="data.ndkp" v-show="active=='2'"></YregisteredView>
          </template>
        </tas-component>
        
      </template>
    </year-model>
  </div>
</template>

<script>
//待审批
import { openMyNdkpJbxx, flowJobPage } from "../../api/yearCheck";
import comVxeTable from "@/views/everydayCheck/components/vxe-table/com-vxe-table";
import YearModel from "../../components/yearCheck/year-model.vue";
import ypscForm from '@/views/everydayCheck/yearCheck/prview/ypscForm'
import TasComponent from '../prview/tas-component.vue';
import YregisteredView from "../prview/YregisteredView.vue";
import {panes} from '../../common/GroupConfig'
export default {
  components: { comVxeTable, YearModel,ypscForm, TasComponent,YregisteredView },
  name: "dengjiPage",
  props: {
    fywflcode: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      columns: [
        {
          type: "checkbox",
        },
        {
          type: "seq",
          title: "序号",
          width: "60",
        },
        {
          field: "fusermc",
          title: "用户名称",
          width: "150",
        },
        {
          field: "fgzdw",
          title: "工作单位",
          width: "150",
        },
        {
          field: "fyear",
          title: "年度",
          width: "150",
        },
        {
          field: "fzjkssj",
          title: "总结开始时间",
          width: "150",
        },
        {
          field: "fzjjssj",
          title: "总结结束时间",
          width: "150",
        },
        {
          field: "ffsrmc",
          title: "发送人",
          width: "150",
        },

        {
          title: "操作",
          field: "operate",
          width: 200,
          slots: { default: "operate", fixed: "right" },
          fixed: "right"
        },
      ],
      queryParams: {},
      config: {},
      data: [],
      allAlign: null,
      formData: {
        fsxmc: "",
        fqymc: "",
        fslsj: "",
        fjzrq: "",
      },
      fromItem: [
        {
          field: "fyear",
          title: "年度",
          type:'input',
          itemRender: {},
          slots: { default: "name_item" },
        },
        {
          field: "fzjjssj",
          type:'datetime',
          title: "总结开始时间",
          itemRender: {},
          slots: { default: "name_item" },
        },
        {
          field: "fzjkssj",
          title: "总结结束时间",
          type:'datetime',
          itemRender: {},
          slots: { default: "name_item" },
        },
      ],
      page: flowJobPage,
      initialize: {
        fywflcode: this.fywflcode,
        fblzt: "待办",
        // fhjmc: "待复核年度考评",
        fhjmc: "待审批年度考评",
      },
      // fndszbg 填写 大文本
      form: {},                                                                             
      model: {},
      // 选项卡
      active:'1',
      panes:panes
    };
  },
  created() {
    
  },
  mounted() {},

  methods: {
    // 编辑
    checkView(row) {
      //console.log(row);
      this.$refs.model.handler(row,{jobid:row.jobid});
    },
    // 选项卡
    tabsCallback(action) {
      //console.log(action,'action=================================');
      this.active = action
    }
  },
};
</script>

<style lang="less" scoped>
// @import "../assets/table.less";
@import url("../../assets/table.less");
</style>
